<template>
  <div>
    <Header />
    <router-view></router-view>
    <!-- 通过元信息的footerIsHidden属性判断元素的显隐，当路由地址为login，register的时候取反为false隐藏元素，反之当路由地址为search与home的时候会拿到一个undefined，undefined取反为true显示组件 -->
    <Footer v-show="!$route.meta.footerIsHidden" />
  </div>
</template>
<script>
import {mapActions} from"vuex"
import Header from "@comp/Header";
import Footer from "@comp/Footer";
export default {
  name: "App",
  components: {
    Header,
    Footer,
  },
  methods: {
    ...mapActions("home", ["getCategoryList"]),
    
  },
  mounted() {
    //初始化首页数据的请求
    this.getCategoryList();
  },
};
</script>

<style lang="less" scoped></style>
